{include(file='header.tpl')}
                {if $arr_error_messages}
                <div class="error">{$language_error_map}: 
                    <ul>
                        {foreach $arr_error_messages key item}
                        <li>{$item}</li>
                        {/foreach}
                    </ul>
                </div>
                {/if}  
               <div id="optionsidebar" class="group">
                    <h2>{$map_title}</h2>
                   <form action="{$base_uri}index.php?input=map&amp;m_id={$arr_params.map_id}" method="post" id="map_props">
                      <p><input type="submit" value="{$language_submit_update_map}" class="refreshmap" id="refreshmap" /></p>
                      <ul class="sidebar_list">
                        {if $map_description}
                            <li id="map_description">
                                <h3>{$language_heading_map_description}</h3>
                                <p>{$map_description}</p>
                            </li>
                        {/if}
                          {if $arr_columns}
                          <li>
                            <h3>{$language_heading_data}</h3>
                            <ul>
                              {foreach $arr_columns key item}
                                <li><label for="column_{$key}">{$key}</label>{$arr_params.arr_table_columns.post.$value}
                                <select name="column_{$key}" id="column_{$key}" class="data_columns">
                                    <option value="-1">{$language_option_view_all}</option>
                                {foreach $item keyitem value}
                                    <option value="{$value}"{if $arr_params.arr_table_columns.$key == $value} selected{/if}>{$value}</option>
                                {/foreach}
                                </select>
                                </li>
                              {/foreach}
                              <li><input type="checkbox" name="slideshow" id="slideshow" /><label for="slideshow">{$language_label_slideshow}</label></li>
                          </ul>
                        </li>
                          {/if}
                        <li id="classification">
                            <h3>{$language_heading_classification}</h3>
                                <ul>
                                    <li><label for="equal_classes">{$language_label_equal_classes}</label><input type="radio" name="classmethod" value="equal" id="equal_classes"{if $arr_params.class_method == 'equal'} checked{/if} /></li>
                                    <li><label for="jenks">{$language_label_jenks}</label><input type="radio" name="classmethod" value="jenks" id="jenks"{if $arr_params.class_method == 'jenks'} checked{/if} /></li>
                                    <li><label for="percentile">{$language_label_percentile}</label><input type="radio" name="classmethod" value="percentile" id="percentile"{if $arr_params.class_method == 'percentile'} checked{/if} /></li>
                                    <li><label for="quantile_classes">{$language_label_quantile_classes}</label><input type="radio" name="classmethod" value="quantile" id="quantile_classes"{if $arr_params.class_method == 'quantile'} checked{/if} /></li>
                                    <li><label for="stddev">{$language_label_stddev}</label><input type="radio" name="classmethod" value="stddev" id="stddev"{if $arr_params.class_method == 'stddev'} checked{/if} /></li>
                                    <li><label for="boxmap15">{$language_label_boxmap15}</label><input type="radio" name="classmethod" value="boxmap15" id="boxmap15"{if $arr_params.class_method == 'boxmap15'} checked{/if} /></li>
                                    <li><label for="boxmap30">{$language_label_boxmap30}</label><input type="radio" name="classmethod" value="boxmap30" id="boxmap30"{if $arr_params.class_method == 'boxmap30'} checked{/if} /></li>
                                    <li><label for="user_classes">{$language_label_user_classes}</label><input type="radio" name="classmethod" value="user" id="user_classes"{if $arr_params.class_method == 'user'} checked{/if} /></li>
                                    <li><label for="classwidth">{$language_label_classwidth}</label><input type="number" min="2" max="10" step="1" name="classwidth" id="classwidth" value="{$arr_params.class_width}"/></li>
                                    <li><div id="equal_classes_options"{if $arr_params.class_method != 'user'} style="display: none;"{/if}><h4>{$language_heading_change_class_limits}</h4>
                                        <p id="equal_classes_option_values">
                                        {if $arr_class_limits}
                                            {foreach $arr_class_limits key item}
                                                {if $key > 0}<span>&lt;</span>{/if}
                                                <input type="text" value="{$item.value}" name="arr_classlimits[]" />
                                            {/foreach}
                                        {/if}
                                        </p>
                                        <p><a href="{$base_uri}index.php?input=map&amp;m_id={$arr_params.map_id}&amp;reset=1" id="reset_class_limits">{$language_reset_class_limits}</a></p>
                                        </div>
                                    </li>
                                </ul>
                        </li>
                        <li>
                            <h3>{$language_heading_coloring}</h3>
                            <ul>
                                <li><label for="base_color" title="{$language_title_base_color}" class="tooltip">{$language_label_base_color}</label><input type="color" name="base_color" id="base_color" class="procolor" value="#{$arr_params.base_color}" /></li>
                                <li><label for="start_color" title="{$language_title_start_color}" class="tooltip">{$language_label_start_color}</label><input type="color" name="start_color" id="start_color" class="procolor" value="#{$arr_params.start_color}" /></li>
                                <li><label for="end_color" title="{$language_title_end_color}" class="tooltip">{$language_label_end_color}</label><input type="color" name="end_color" id="end_color" class="procolor" value="#{$arr_params.end_color}" /></li>
                                <li><label for="border_color" title="{$language_title_border_color}" class="tooltip">{$language_label_border_color}</label><input type="color" name="border_color" id="border_color" class="procolor" value="#{$arr_params.border_color}" /></li>
                                <li><label for="layer_opacity">{$language_label_opacity}</label><input type="range" min="0" max="100" step="5" value="{$arr_params.layer_opacity}" id="layer_opacity" name="layer_opacity" /></li>
                            </ul>
                        </li>
                        <li>
                            <h3>{$language_heading_caption}</h3>
                            <ul>
                                <li><label for="map_label">{$language_label_caption}</label>
                                    <select name="map_label" id="map_label">
                                        <option value="region"{if $arr_params.map_label == "region"} selected{/if}>{$language_option_label_name}</option>
                                        <option value="region_id"{if $arr_params.map_label == "region_id"} selected{/if}>{$language_option_label_id}</option>
                                        <option value="id_name"{if $arr_params.map_label == "id_name"} selected{/if}>{$language_option_label_id_name}</option>
                                        <option value="label_empty"{if $arr_params.map_label == "label_empty"} selected{/if}>{$language_option_label_empty}</option>
                                    </select>
                                </li>
                                <li><label for="map_fontsize_label">{$language_label_fontsize_label}</label>
                                    <select name="map_fontsize_label" id="map_fontsize_label">
                                    {for cnt 1 30}
                                    <option value="{$cnt}"{if $arr_params.map_fontsize_label == $cnt} selected{/if}>{$cnt}</option> 
                                    {/for}
                                    </select>
                                </li>
                            </ul>
                        </li>
                        <li>
                            <h3>{$language_heading_analysis}</h3>
                            <ul id="analysis">
                                <li><a href="{$base_uri}index.php?input=map&amp;m_id={$arr_params.map_id}&amp;analysis=datatable" class="analysiswindow">{$language_analysis_table}</a></li>
                                <li><a href="{$base_uri}index.php?input=map&amp;m_id={$arr_params.map_id}&amp;analysis=diagram">{$language_analysis_diagram}</a></li>
                                <li><a href="{$base_uri}index.php?input=map&amp;m_id={$arr_params.map_id}&amp;analysis=histogram" class="analysiswindow">{$language_analysis_histogram}</a></li>
                                <li><a href="{$base_uri}index.php?input=map&amp;m_id={$arr_params.map_id}&amp;analysis=stats" class="analysiswindow">{$language_analysis_stats}</a></li>
                                <li><a href="{$base_uri}index.php?input=map&amp;m_id={$arr_params.map_id}&amp;analysis=boxplot">{$language_analysis_boxplot}</a></li>
                                <li><a href="{$base_uri}index.php?input=map&amp;m_id={$arr_params.map_id}&amp;analysis=moran">{$language_analysis_spatial}</a></li>
                            </ul>
                        </li>
                        {if $arr_layers}
                        <li>
                            <h3>{$language_heading_layers}</h3>
                            <ul id="layers">
                                {foreach $arr_layers key item}
                                <li><input type="checkbox" value="{$key}" name="arr_layers[]" id="layer_{$key}" /><label for="layer_{$key}">{$item}</label> <a href="{$base_uri}index.php?input=map&amp;m_id={$arr_params.map_id}&amp;overlay={$key}">{$language_edit_layer}</a></li>
                                {/foreach}
                            </ul>
                        </li>
                        {/if}
                    </ul>
                    </form>
                    <form action="{$base_uri}index.php?input=map&amp;m_id={$arr_params.map_id}" method="post">
                    <ul class="sidebar_list">
                        <li>
                            <h3>{$language_heading_image_export}</h3>
                            <ul>
                                <li>
                                    <label for="paper_size">{$language_export_paper_size}</label>
                                    <select name="paper_size" id="paper_size">
                                    {foreach $arr_paper_sizes key name}
                                        <option value="{$key}">{$name}</option>
                                    {/foreach}
                                    </select>
                                </li>
                                <li>
                                    <label for="paper_orientation">{$language_export_paper_orientation}</label>
                                    <select name="paper_orientation" id="paper_orientation">
                                        <option value="landscape">{$language_option_orientation_landscape}</option>
                                        <option value="portrait">{$language_option_orientation_portrait}</option>
                                    </select>
                                </li>
                                <li>
                                    <label for="image_quality">{$language_export_image_quality}</label>
                                    <input type="number" min="60" max="400" step="1" name="image_quality" id="image_quality" value="72" />
                                </li>
                                <li style="display: none;"><label for="export_width">{$language_export_width}</label> <input type="text" name="export_width" id="export_width" /></li>
                                <li style="display: none;"><label for="export_height">{$language_export_height}</label> <input type="text" name="export_height" id="export_height" /></li>
                                <li><input type="checkbox" name="export_tile" id="export_tile" value="1" /><label for="export_tile">{$language_export_tile}</label></li>
                                <li>
                                    <label for="legend_position">{$language_legend_position}</label>
                                    <select name="legend_position" id="legend_position">
                                        <option value="MS_UL"{if $arr_params.legend_position_string == "MS_UL"} selected{/if}>{$language_mapserver_position_ul}</option>
                                        <option value="MS_UR"{if $arr_params.legend_position_string == "MS_UR"} selected{/if}>{$language_mapserver_position_ur}</option>
                                        <option value="MS_UC"{if $arr_params.legend_position_string == "MS_UC"} selected{/if}>{$language_mapserver_position_uc}</option>
                                        <option value="MS_LL"{if $arr_params.legend_position_string == "MS_LL"} selected{/if}>{$language_mapserver_position_ll}</option>
                                        <option value="MS_LR"{if $arr_params.legend_position_string == "MS_LR"} selected{/if}>{$language_mapserver_position_lr}</option>
                                        <option value="MS_LC"{if $arr_params.legend_position_string == "MS_LC"} selected{/if}>{$language_mapserver_position_lc}</option>
                                    </select>
                                </li>
                                <li>
                                    <label for="scalebar_position">{$language_scalebar_position}</label>
                                    <select name="scalebar_position" id="scalebar_position">
                                        <option value="MS_UL"{if $arr_params.scalebar_position_string == "MS_UL"} selected{/if}>{$language_mapserver_position_ul}</option>
                                        <option value="MS_UR"{if $arr_params.scalebar_position_string == "MS_UR"} selected{/if}>{$language_mapserver_position_ur}</option>
                                        <option value="MS_UC"{if $arr_params.scalebar_position_string == "MS_UC"} selected{/if}>{$language_mapserver_position_uc}</option>
                                        <option value="MS_LL"{if $arr_params.scalebar_position_string == "MS_LL"} selected{/if}>{$language_mapserver_position_ll}</option>
                                        <option value="MS_LR"{if $arr_params.scalebar_position_string == "MS_LR"} selected{/if}>{$language_mapserver_position_lr}</option>
                                        <option value="MS_LC"{if $arr_params.scalebar_position_string == "MS_LC"} selected{/if}>{$language_mapserver_position_lc}</option>
                                    </select>
                                </li>
                                <li><label for="copyright">{$language_copyright_note}</label> <input type="text" name="copyright" id="copyright" value="© {date_format $.now "%Y"} polwebgis" /></li>
                                <li><input type="submit" value="{$language_submit_image_export}" name="export" /></li>
                            </ul>
                        </li>
                        <li>
                            <h3>{$language_heading_excel_export}</h3>
                            <ul>
                                <li><input type="submit" value="{$language_submit_excel_export}" name="excelexport" /></li>
                            </ul>
                        </li>
                    </ul>
                    </form>
                </div>
                <div id="mapcontainter">
                   <div id="map" class="skip"></div>
                   {if $imageurl != -1}
                   <div id="no_js_map"><img src="{$imageurl}"></div>
                   {/if}
               </div>
{include(file='js.tpl')}
               <script type='text/javascript' src='{$base_uri}output/js/modernizr.js'></script>
               <script type='text/javascript' src='{$base_uri}output/js/procolor.js'></script>
               <script type="text/javascript" src="{$base_uri}output/js/prototype/scriptaculous/scriptaculous.js?load=effects,dragdrop"></script>
               <script type="text/javascript">
               /* <![CDATA[ */
                    var arr_bbox = new Array(4);
                    {foreach $arr_map_extent key item}
                        arr_bbox[{$key}] = {$item};
                    {/foreach}
                    new Policies_Ui_Map("{$wms_url}", {$map_projection}, arr_bbox, {$map_max_resolution}, false, "{$legend_url}");
               {literal}
                    new Spindown({class_name : 'sidebar_list', clickable_element_class : 'spindown-heading'});
                    Sortable.create('layers');
                {/literal}
                /* ]]> */
               </script>
{include(file='footer.tpl')}
